package com.yanqu.road.server.cmd.banquet.party;

import com.yanqu.road.entity.banquet.cross.CrossBanquetData;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.banquet.CrossPartyMgr;
import com.yanqu.road.server.manger.CrossMarriageGroupMgr;
import com.yanqu.road.server.pb.banquet.CrossBanquetPb;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.Protocol;

import java.util.List;

@Cmd(code = CrossProtocol.C_CROSS_PARTY_FEAST_SYNC, desc = "")
public class CrossFeastPartySyncCmd extends CrossCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        long userId = packet.getPlayerId();
        List<CrossBanquetData> party = CrossPartyMgr.getBanquetFeast(CrossMarriageGroupMgr.getFeastPartyServerList(serverId));
        YanQuMessage message = YanQuMessageUtils.buildMessage(Protocol.U_BANQUET_FEAST_SYNC, CrossBanquetPb.parseBanquetFeastListRespMsg(userId, party));
        MessageHelper.sendPacket(serverId, userId, message);
    }

    @Override
    public void sendData() {

    }
}
